<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">

$(function(){

	$("#dataTable").datagrid({
		toolbar: '#dataSearch',
		fitColumns:true,
		striped: true, 
		singleSelect:false,
		pagination:true,
		rownumbers:true,
		SelectOnCheck:true,
		CheckOnSelect:true,
        onSelect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onSelectAll: function(rows){
        	var nos="";
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselectAll: function(rows){
			$("#keys").val("");
    	}
	});
	
	$('#dataTable').datagrid('getPager').pagination({
		total:<s:property value="pageInfo.pageRecord"/>,
		pageNumber:<s:property value="pageInfo.pageIndex"/>,
		pageSize:<s:property value="pageInfo.pageSize"/>,
		pageList: [20,50,100] ,
		onSelectPage:function(pageNumber,pageSize){  
			toPage(pageNumber,pageSize);
		},
		onRefresh:function(pageNumber,pageSize){  
			location.reload();
		}
	});
	
});

</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="rof_viewresource.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr>
<td height="25" >
	<b>操作说明:资源查询</b> 
</td>
</tr>
<tr><td height="30" >
<s:textfield name="resName" id="resName" placeholder="资源名称"></s:textfield>
<s:textfield name="optId" id="optId" placeholder="操作员工号"></s:textfield>
<s:textfield name="optName" id="optName" placeholder="操作员姓名"></s:textfield>
<s:select id="resState" name="resState" list="#{'1':'启用','0':'停用'}" headerKey="" headerValue="状态"  />

<s:textfield  id="resDateTop"  name="resDateTop" placeholder="登记日期起" onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="resDateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="resDateEnd"  name="resDateEnd" placeholder="登记日期止" onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="resDateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>

<input type="button" class="submit" value="查询搜索" onclick="sform.submit();"/></td>
</tr>
<tr><td><hr/></td></tr>
<tr>
<td height="30" >
	<input type="hidden"  id="keys" name="keys"  value=""/>
		<input type="button" class="submit" value="新增记录" onclick="location.href='<%=request.getContextPath()%>/rof_editresource.html'"/>
		<input type="button" class="submit"   value="导出数据"  onclick="if(confirm('确认要执行导出操作吗?')){window.open(location.href.replace('list','export'));}"/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="日期排序" onclick="toSort('sortField','resDate')"/>
		<input type="button" class="submit" value="工号排序" onclick="toSort('sortField','resId')"/>
		
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="升序排列" onclick="toSort('sortOrder','true')"/>
		<input type="button" class="submit" value="降序排列" onclick="toSort('sortOrder','false')"/>
</td>
</tr>
</table>
</form>
</div>

<table id="dataTable" style="width: 100%;" class="easyui-datagrid" >
<thead>
<tr>
<th data-options="field:'ck'" checkbox="true"></th>
<th data-options="field:'resName', width:'15%',align:'left' , halign: 'left'">名称</th>
<th data-options="field:'optId', width:'10%',align:'left' , halign: 'left'">操作员ID</th>
<th data-options="field:'optName', width:'10%',align:'left' , halign: 'left'">操作员姓名</th>
<th data-options="field:'resAction', width:'15%',align:'left' , halign: 'left'">资源类</th>
<th data-options="field:'resMethod', width:'10%',align:'left' , halign: 'left'">资源方法</th>
<th data-options="field:'resType', width:'10%',align:'left' , halign: 'left'">控制类型</th>
<th data-options="field:'resState', width:'5%',align:'left' , halign: 'left'">状态</th>
<th data-options="field:'resDate', width:'15%',align:'left' , halign: 'left'">登记日期</th>
<th data-options="field:'op', width:'100',align:'left' , halign: 'left'">操作</th>
</tr>
</thead>
<tbody>
<s:iterator value="operatorResourceList" id="show" status="seq">
<tr>
<td><s:property value="#show.resNo"/></td>
<td><s:property value="#show.resName"/></td>
<td><s:property value="#show.optId"/></td>
<td><s:property value="#show.optName"/></td>
<td><s:property value="#show.resAction"/></td>
<td><s:property value="#show.resMethod"/></td>
<td><s:property value="#show.resType"/></td>
<td>
		<s:if test="#show.resState==1">
			<img src="<%=request.getContextPath() %>/image/accept.png"  />
		</s:if>
		<s:else>
			<img src="<%=request.getContextPath() %>/image/cancel.png"  />
		</s:else>
</td>
<td><s:text name="global.format.shortdatetime"><s:param value="#show.resDate"/></s:text>
<td>
<input type="button" value="修改信息" class="submit" onclick="location.href='<%=request.getContextPath()%>/rof_editresource.html?resNo=<s:property value="#show.resNo"/>'"/>
</td>

</tr>
</s:iterator>
</tbody>
</table>
<br/>
<br/>
<br/>
</body>
</html>
